//
//  UILABEL (FRAME).m
//  CJMobile
//
//  Created by manluqiusuo on 15/9/16.
//  Copyright (c) 2015年 长江证券. All rights reserved.
//

#import "NSString+Frame.h"

@implementation NSString (Frame)

- (CGSize)boundsRectWithWidth:(NSUInteger)width font:(UIFont *)font {
    
    NSDictionary *attribute = @{NSFontAttributeName: font};
    CGSize retSize = [self boundingRectWithSize:CGSizeMake(width, 0)
                                             options:\
                      NSStringDrawingTruncatesLastVisibleLine |
                      NSStringDrawingUsesLineFragmentOrigin |
                      NSStringDrawingUsesFontLeading
                                          attributes:attribute
                                             context:nil].size;
    
    return retSize;
}

@end
